;; 增强交互功能的插件集
(require 'init-package)

;; diminish 修改 modline 中 major-mode 和 minor-mode 的显示方式
;; (when (maybe-require-package 'diminish)
;;   ;;(diminish 'eldoc-mode)
;;   (diminish 'abbrev-mode "abv"))

;; 键位提示
(when (maybe-require-package 'which-key)
  (which-key-mode t)
  (which-key-setup-side-window-bottom)
  (when (package-installed-p 'diminish)

    (eval-after-load 'which-key-mode
      (diminish 'which-key-mode))))

;; 窗口跳转
(when (maybe-require-package 'ace-window)
  (autoload 'ace-window "ace-window" "Ace window switch.")
  (global-set-key [remap other-window] 'ace-window)
  (custom-set-faces '(aw-leading-char-face
                      ((t (:inherit ace-jump-face-foreground
                                    :height 3.0
                                    :foreground "magenta"))))))

;; imenu-list 侧边栏
(when (maybe-require-package 'imenu-list)
  (setq imenu-list-size 30
        imenu-list-position 'right
        imenu-list-focus-after-activation t)
  (global-set-key (kbd "<f12>") 'imenu-list-smart-toggle)
  )

;; ;; NeoTree
;; (when (maybe-require-package 'neotree)
;;   (global-set-key (kbd "<f2>") 'neotree-toggle))

;; avy 强大的字符跳转工具
(when (maybe-require-package 'avy)
  (define-prefix-command 'leader-key-avy)
  (global-set-key (kbd "M-j")   'leader-key-avy)
  (define-key 'leader-key-avy "SPC" 'avy-goto-char-timer)
  (define-key 'leader-key-avy "l" 'avy-goto-line)
  (define-key 'leader-key-avy "w" 'avy-goto-word-0)
  (define-key 'leader-key-avy "c" 'avy-copy-line)
  (define-key 'leader-key-avy "C" 'avy-copy-region)
  (define-key 'leader-key-avy "<return>" 'avy-move-line)
  (define-key 'leader-key-avy "M-<return>" 'avy-move-region)
)

(provide 'init-interactive)
